home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Scene Storm
/
Scene Storm - Volume 1.iso
/
coding
/
c
/
amiexpress
/
utils
/
conacp3.00
/
conacp.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-12-26
|
22KB
|
721 lines
#include <exec/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <workbench/workbench.h>
#include <dos/dosextens.h>
#include <clib/dos_protos.h>
#include <clib/exec_protos.h>
#include <clib/icon_protos.h>
struct Library *IconBase;
struct PSTR
{
int s1;
int s2;
int ns;
int ne;
};
void ReadStartUp(void);
int CheckConfigNode(char str[],FILE *fo);
int ParseImage(char *str,struct PSTR *p);
void sr(char *str);
void strleft(char *str,char *str1);
void MakeIcons(void);
void MakeModuleIcons(void);
int atoileft(char str[]);
void GetStr(char *d,char *s,int num);
void CreateConfs(void);
void MakeAreaIcons(void);
void ConvertUserData(void);
#define CMDLOOP for(i=p.ns;i<=p.ne;i++)
main()
{
char image[200];
char string[200];
FILE *fi;
fi=fopen("S:ACP.Startup","r");
if(fi==NULL)
{
printf("Error, can't locate s:acp.startup\n");
exit(0);
}
fclose(fi);
fi=fopen("BBS:User.Data","r");
if(fi==NULL)
{
printf("Error, can't locate BBS:User.Data\n");
exit(0);
}
fclose(fi);
IconBase=OpenLibrary("icon.library",0L);
printf("Reading ACP.STARTUP\n");
printf("Scanning User.Data\n");
Execute("AE3.0_Disk1:Utils/ConvertDB BBS:User.Data",NULL,NULL);
printf("Sorting User.Data Conference Accesses\n");
Execute("Sort BBS:User.Data.Lst to RAM:AreaList",NULL,NULL);
printf("Stripping Conference Access Duplicates\n");
Execute("AE3.0_Disk1:Utils/StripDupe RAM:AreaList",NULL,NULL);
ConvertUserData();
printf("Building Icon Definition File\n");
ReadStartUp();
printf("Renaming BBS:Fcheck to BBS:Fcheck.old\n");
Rename("BBS:Fcheck","BBS:Fcheck.old");
printf("Renaming BBS:Commands to BBS:Commands.old\n");
Rename("BBS:Commands","BBS:Commands.old");
printf("Copying New Commands & Fcheck Drawers to BBS:\n");
Execute("Copy >NIL: AE3.0_DISK2:BBS/Fcheck#? to BBS: all",NULL,NULL);
Execute("Copy >NIL: AE3.0_Disk2:BBS/Commands#? to BBS: all",NULL,NULL);
printf("Copying ScreenTypes to BBS:\n");
Execute("Copy >NIL: AE3.0_Disk2:BBS/Screentypes.info to BBS:",NULL,NULL);
printf("Copying Express 3.0 to BBS:\n");
Execute("Copy >NIL: AE3.0_Disk2:BBS/Express#? to BBS:",NULL,NULL);
printf("Copying Access Drawer to BBS:\n");
Execute("Copy >NIL: AE3.0_Disk2:BBS/Access#? to BBS: ALL",NULL,NULL);
printf("Creating ICON definitions for BBSCmds\n");
MakeModuleIcons();
MakeAreaIcons();
sprintf(image,"sort ram:acp.convert to ram:acp.srt");
Execute(image,NULL,NULL);
printf("Making Icons\n");
MakeIcons();
CreateConfs();
CloseLibrary(IconBase);
exit(0);
}
void ConvertUserData(void)
{
FILE *fi,*fo;
int i;
char image[100];
DeleteFile("RAM:AreaList.Old");
Rename("RAM:AreaList","RAM:AreaList.old");
fi=fopen("RAM:AreaList.old","r");
fo=fopen("RAM:AreaList","w");
i=0;
while(fgets(image,90,fi)!=NULL)
{
sr(image);
i++;
fprintf(fo,"%s %d\n",image,i);
}
fclose(fi);
fclose(fo);
Execute("AE3.0_Disk1:Utils/ConvertDB BBS:User.Data RAM:AreaList",NULL,NULL);
Execute("Copy BBS:User.Data.New to BBS:User.Data",NULL,NULL);
Execute("AE3.0_Disk1:Utils/StripUser BBS:User.Data",NULL,NULL);
Execute("Copy BBS:User.Data.New to BBS:User.Data",NULL,NULL);
}
int nodes;
void MakeModuleIcons(void)
{
FILE *fi,*fo;
char image[200];
char doorcommand[200];
char acs[200];
char type[200];
char MultiNode[200];
char location[200];
BPTR lock;
int error;
int j;
fi=fopen("BBS:Commands.old/BBS.CMD","r");
if(fi!=NULL)
{
printf("Converting BBS Modules\n");
fo=fopen("RAM:ACP.Convert","a");
while(fgets(image,80,fi)!=NULL)
{
error=0;
sr(image);
strcpy(doorcommand,image);
doorcommand[10]='\0'; sr(doorcommand);
switch(image[10])
{
case 'X': strcpy(type,"TYPE=XIM"); break;
case 'P': strcpy(type,"TYPE=TIM"); break;
case 'R': strcpy(type,"TYPE=AIM"); break;
default: error=1;
}
switch(image[11])
{
case 'S': strcpy(MultiNode,"MULTINODE=NO"); break;
case 'M': strcpy(MultiNode,"MULTINODE=YES"); break;
default: error=1;
}
sprintf(acs,"%3.3s",&image[12]);
strcpy(location,&image[15]);
if(!error)
{
printf("\tModule: %s Converted\n",doorcommand);
fprintf(fo,"MODULE.DEF P BBS:Commands/BBSCmd/%s LOCATION=%s\n",doorcommand,location);
fprintf(fo,"MODULE.DEF P BBS:Commands/BBSCmd/%s %s\n",doorcommand,type);
fprintf(fo,"MODULE.DEF P BBS:Commands/BBSCmd/%s %s\n",doorcommand,MultiNode);
fprintf(fo,"MODULE.DEF P BBS:Commands/BBSCmd/%s ACCESS=%s\n",doorcommand,acs);
fprintf(fo,"MODULE.DEF P BBS:Commands/BBSCmd/%s STACK=50000\n",doorcommand);
fprintf(fo,"MODULE.DEF P BBS:Commands/BBSCmd/%s PRIORITY=0\n",doorcommand);
}
else
printf("Error creating %s Module\n",doorcommand);
}
fclose(fo);
fclose(fi);
}
fi=fopen("BBS:Commands.old/Sys.CMD","r");
if(fi!=NULL)
{
printf("Converting System Modules\n");
fo=fopen("RAM:ACP.Convert","a");
while(fgets(image,80,fi)!=NULL)
{
error=0;
sr(image);
strcpy(doorcommand,image);
doorcommand[10]='\0'; sr(doorcommand);
switch(image[10])
{
case 'X': strcpy(type,"TYPE=XIM"); break;
case 'P': strcpy(type,"TYPE=TIM"); break;
case 'R': strcpy(type,"TYPE=AIM"); break;
default: error=1;
}
switch(image[11])
{
case 'S': strcpy(MultiNode,"MULTINODE=NO"); break;
case 'M': strcpy(MultiNode,"MULTINODE=YES"); break;
default: error=1;
}
sprintf(acs,"%3.3s",&image[12]);
strcpy(location,&image[15]);
if(!error)
{
printf("\tModule: %s Converted\n",doorcommand);
fprintf(fo,"MODULE.DEF P BBS:Commands/SysCmd/%s LOCATION=%s\n",doorcommand,location);
fprintf(fo,"MODULE.DEF P BBS:Commands/SysCmd/%s %s\n",doorcommand,type);
fprintf(fo,"MODULE.DEF P BBS:Commands/SysCmd/%s %s\n",doorcommand,MultiNode);
fprintf(fo,"MODULE.DEF P BBS:Commands/SysCmd/%s ACCESS=%s\n",doorcommand,acs);
fprintf(fo,"MODULE.DEF P BBS:Commands/SysCmd/%s STACK=50000\n",doorcommand);
fprintf(fo,"MODULE.DEF P BBS:Commands/SysCmd/%s PRIORITY=0\n",doorcommand);
}
else
printf("Error creating %s Module\n",doorcommand);
}
fclose(fo);
fclose(fi);
}
for(j=1;j<10;j++)
{
sprintf(image,"BBS:Commands.old/Conf%d.Cmd",j);
fi=fopen(image,"r");
if(fi!=NULL)
{
sprintf(image,"BBS:Commands/Conf%dCmd",j);
printf("Converting Conference %d Modules\n",j);
fo=fopen("RAM:ACP.Convert","a");
if(lock=CreateDir(image))
{
printf("Creating %s Directory\n",image);
UnLock(lock);
sprintf(image,"DRAWER D BBS:Commands/Conf%dCmd CONF%d.MODULES\n",j,j);
fprintf(fo,"%s",image);
}
while(fgets(image,80,fi)!=NULL)
{
error=0;
sr(image);
strcpy(doorcommand,image);
doorcommand[10]='\0'; sr(doorcommand);
switch(image[10])
{
case 'X': strcpy(type,"TYPE=XIM"); break;
case 'P': strcpy(type,"TYPE=TIM"); break;
case 'R': strcpy(type,"TYPE=AIM"); break;
default: error=1;
}
switch(image[11])
{
case 'S': strcpy(MultiNode,"MULTINODE=NO"); break;
case 'M': strcpy(MultiNode,"MULTINODE=YES"); break;
default: error=1;
}
sprintf(acs,"%3.3s",&image[12]);
strcpy(location,&image[15]);
if(!error)
{
printf("\tModule: %s Converted\n",doorcommand);
fprintf(fo,"MODULE.DEF P BBS:Commands/Conf%dCmd/%s LOCATION=%s\n",j,doorcommand,location);
fprintf(fo,"MODULE.DEF P BBS:Commands/Conf%dCmd/%s %s\n",j,doorcommand,type);
fprintf(fo,"MODULE.DEF P BBS:Commands/Conf%dCmd/%s %s\n",j,doorcommand,MultiNode);
fprintf(fo,"MODULE.DEF P BBS:Commands/Conf%dCmd/%s ACCESS=%s\n",j,doorcommand,acs);
fprintf(fo,"MODULE.DEF P BBS:Commands/Conf%dCmd/%s STACK=50000\n",j,doorcommand);
fprintf(fo,"MODULE.DEF P BBS:Commands/Conf%dCmd/%s PRIORITY=0\n",j,doorcommand);
}
else
printf("Error creating %s Module\n",doorcommand);
}
fclose(fo);
fclose(fi);
}
}
}
void MakeAreaIcons(void)
{
FILE *fi,*fo;
char image[200];
int i;
int error;
fi=fopen("RAM:AreaList","r");
if(fi!=NULL)
{
fo=fopen("RAM:ACP.Convert","a");
while(fgets(image,80,fi)!=NULL)
{
sr(image);
i=1; while(i<10)
{
if(image[i-1]=='X')
fprintf(fo,"AREA.DEF P BBS:ACCESS/AREA.%s CONF.%d\n",&image[11],i);
i++;
}
}
fclose(fo);
fclose(fi);
}
}
void CreateConfs(void)
{
FILE *fo,*fi;
struct DiskObject *dobj;
char **tooltypes;
char *s;
char temp[200];
char location[200];
int i=1;
int j;
strcpy(temp,"BBS:ConfConfig");
dobj=GetDiskObject(temp);
if(dobj)
{
tooltypes=dobj->do_ToolTypes;
sprintf(temp,"LOCATION.%d",i++);
while(s=FindToolType(tooltypes,temp))
{
fo=fopen("ram:temp","w");
strcpy(location,s);
sprintf(temp,"%sFREEDOWNLOADS");
if(!access(temp,00))
{
fprintf(fo,"FREEDOWNLOADS\n");
}
sprintf(temp,"%sPaths",location);
if(!access(temp,00))
{
fi=fopen(temp,"r");
j=1;
while(fgets(temp,80,fi)!=NULL)
{
sr(temp);
fprintf(fo,"DLPATH.%d=%s\n",j++,temp);
}
fclose(fi);
}
j=1;
sprintf(temp,"%sULPaths",location);
fprintf(fo,"ULPATH.%d=%sUpload/\n",j++,location);
if(!access(temp,00))
{
fi=fopen(temp,"r");
while(fgets(temp,80,fi)!=NULL)
{
sr(temp);
fprintf(fo,"ULPATH.%d=%s\n",j++,temp);
}
fclose(fi);
}
sprintf(temp,"%sNDIRS",location);
if(!access(temp,00))
{
fi=fopen(temp,"r");
fgets(temp,80,fi);
sr(temp);
fprintf(fo,"NDIRS=%s\n",temp);
}
printf("Converting MsgBase for %s\n",location);
sprintf(temp,"AE3.0_Disk1:Utils/ConVMsg %sMsgBase/HeaderFile",location);
Execute(temp,NULL,NULL);
if(location[strlen(location)-1]=='/') location[strlen(location)-1]='\0';
sprintf(temp,"AE3.0_Disk1:Utils/NewObj AE3.0_Disk1:Storage/Icons/Drawer.info %s.info DRAWER RAM:Temp",location);
fclose(fo);
Execute(temp,NULL,NULL);
sprintf(temp,"Copy AE3.0_Disk1:Storage/NewConf/Conf.DB#? to %s ALL",location);
Execute(temp,NULL,NULL);
sprintf(temp,"LOCATION.%d",i++);
}
FreeDiskObject(dobj);
}
strcpy(temp,"BBS:Ami_Drives");
if(!access(temp,00))
{
fo=fopen("ram:temp","w");
fi=fopen(temp,"r");
j=1;
while(fgets(temp,80,fi)!=NULL)
{
sr(temp);
fprintf(fo,"DRIVE.%d=%s\n",j++,temp);
}
fclose(fi);
fclose(fo);
strcpy(temp,"AE3.0_Disk1:Utils/NewObj AE3.0_Disk1:Storage/Icons/DRIVES.DEF.info BBS:DRIVES.info TOOL RAM:Temp");
Execute(temp,NULL,NULL);
}
fo=fopen("Ram:Temp","w");
fprintf(fo,"START.300=0\n");
fprintf(fo,"END.300=2359\n");
fprintf(fo,"START.1200=0\n");
fprintf(fo,"END.1200=2359\n");
fprintf(fo,"START.2400=0\n");
fprintf(fo,"END.2400=2359\n");
fprintf(fo,"START.4800=0\n");
fprintf(fo,"END.4800=2359\n");
fprintf(fo,"START.7200=0\n");
fprintf(fo,"END.7200=2359\n");
fprintf(fo,"START.9600=0\n");
fprintf(fo,"END.9600=2359\n");
fprintf(fo,"START.14400=0\n");
fprintf(fo,"END.14400=2359\n");
fprintf(fo,"START.16800=0\n");
fprintf(fo,"END.16800=2359\n");
fprintf(fo,"START.19200=0\n");
fprintf(fo,"END.19200=2359\n");
fclose(fo);
i=0; while(i<nodes)
{
sprintf(temp,"AE3.0_Disk1:Utils/NewObj AE3.0_Disk1:Storage/Icons/TIMES.DEF.info BBS:Node%d/TIMES.DEF.info TOOL Ram:Temp",i++);
Execute(temp,NULL,NULL);
}
}
void GetStr(char *d,char *s,int num)
{
register int i=0;
while(num)
{
if(*(s+i)==' ') { num--;}
i++;
}
strcpy(d,&s[i]);
i=0;
while(*(d+i)!=' ' && *(d+i)!='\0') i++;
*(d+i)='\0';
}
void MakeIcons(void)
{
FILE *fi,*fo;
char image[200];
char IconName[200];
char IconType[200];
char DestName[200];
char ToolType[200];
char TempName[200];
char Command[200];
char Type[200];
int old=0;
fi=fopen("RAM:ACP.SRT","r");
fo=fopen("RAM:temp","w");
strcpy(DestName,""); strcpy(TempName,"");
while(fgets(image,80,fi)!=NULL)
{
sr(image);
GetStr(IconName,image,0);
GetStr(IconType,image,1);
GetStr(DestName,image,2);
GetStr(ToolType,image,3);
if(old && strcmp(TempName,DestName))
{
fclose(fo);
Execute(Command,NULL,NULL);
fo=fopen("RAM:temp","w");
}
switch(IconType[0])
{
case 'D': strcpy(Type,"DRAWER"); break;
case 'T': strcpy(Type,"TOOL"); break;
case 'P': strcpy(Type,"PROJECT"); break;
}
sprintf(Command,"AE3.0_Disk1:Utils/NewObj AE3.0_Disk1:Storage/Icons/%s.info %s.info %s RAM:Temp",IconName,DestName,Type);
fprintf(fo,"%s\n",ToolType);
strcpy(TempName,DestName);
old=1;
}
fclose(fi);
fclose(fo);
Execute(Command,NULL,NULL);
}
void ReadStartUp(void)
{
FILE *fi,*fo;
char image[200];
char im2[200];
register int i;
int Backup=1;
int Restrict=1;
int j;
fi=fopen("s:acp.startup","r");
fo=fopen("ram:acp.convert","w");
if(fi==NULL)
{
return;
}
fprintf(fo,"ACP.DEF T AE3.0_Disk1:WbStartup/ACP DONOTWAIT\n");
fprintf(fo,"ACP.DEF T AE3.0_Disk1:WbStartup/ACP MULTICOM_PORT\n");
while(fgets(image,80,fi)!=NULL)
{
sr(image);
if(!strnicmp(image,"NUMBER_OF_NODES",15))
{
nodes=atoileft(&image[15]);
fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP NODES=%d\n",nodes);
continue;
}
if(CheckConfigNode(image,fo)) continue;
if(!strcmp(image,"ICONIFY"))
{
fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP ICONIFIED\n"); continue; }
if(!strnicmp(image,"ITop",4))
{
j=atoileft(&image[4]);
fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP ICONIFY.TOPEDGE=%d\n",j);
continue;
}
/*
if(!strnicmp(image,"BACKUP",6))
{
strleft(im2,&image[6]);
fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP BACKUP.%d=%s\n",Backup,im2); Backup++;
continue;
}
if(!strnicmp(image,"RESTRICT",8))
{
strleft(im2,&image[8]);
fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP RESTRICT.%d=%s\n",Restrict,im2); Restrict++;
continue;
}
*/
if(!strnicmp(image,"ILeft",5))
{
j=atoileft(&image[5]);
fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP ICONIFY.LEFTEDGE=%d\n",j);
continue;
}
}
fclose(fi);
i=0; while(i<nodes)
{
fprintf(fo,"DRAWER D BBS:Node%d NODESTART=BBS:EXPRESS\n",i);
sprintf(image,"Copy >nil: AE3.0_Disk1:Storage/NewNode/Serial#? to BBS:Node%d ALL\n",i);
Execute(image,NULL,NULL);
sprintf(image,"Copy >nil: AE3.0_Disk1:Storage/NewNode/Modem#? to BBS:Node%d ALL\n",i);
Execute(image,NULL,NULL);
sprintf(image,"Copy >nil: AE3.0_Disk1:Storage/NewNode/Nrams#? to BBS:Node%d ALL\n",i);
Execute(image,NULL,NULL);
i++;
}
fclose(fo);
}
int CheckConfigNode(char str[],FILE *fo)
{
register int i;
struct PSTR p;
char temp2[200];
if(ParseImage(str,&p))
{
if(!strnicmp(&str[p.s1],"LEFTEDGE",8))
{ CMDLOOP fprintf(fo,"WINDOW.DEF P BBS:Node%d/WINDOW.DEF WINDOW.LEFTEDGE=%d\n",i,atoi(&str[p.s2])); return(1); }
if(!strnicmp(&str[p.s1],"TOPEDGE",7))
{ CMDLOOP fprintf(fo,"WINDOW.DEF P BBS:Node%d/WINDOW.DEF WINDOW.TOPEDGE=%d\n",i,atoi(&str[p.s2])); return(1); }
if(!strnicmp(&str[p.s1],"WIDTH",5))
{ CMDLOOP fprintf(fo,"WINDOW.DEF P BBS:Node%d/WINDOW.DEF WINDOW.WIDTH=%d\n",i,atoi(&str[p.s2])); return(1); }
if(!strnicmp(&str[p.s1],"HEIGHT",6))
{ CMDLOOP fprintf(fo,"WINDOW.DEF P BBS:Node%d/WINDOW.DEF WINDOW.HEIGHT=%d\n",i,atoi(&str[p.s2])); return(1); }
if(!strnicmp(&str[p.s1],"BITPLANES",9))
{ CMDLOOP fprintf(fo,"WINDOW.DEF P BBS:Node%d/WINDOW.DEF WINDOW.NUM_COLORS=8\n",i); return(1); }
if(!strnicmp(&str[p.s1],"LOGOFFBATCH",11))
{ CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d BATCH.LOGOFF=%s\n",i,&str[p.s2]); return(1); }
if(!strnicmp(&str[p.s1],"SHUTDOWN_BATCH",14))
{ CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d BATCH.SHUTDOWN=%s\n",i,&str[p.s2]); return(1); }
if(!strnicmp(&str[p.s1],"STATBAR",7))
{
CMDLOOP fprintf(fo,"WINDOW.DEF P BBS:Node%d/WINDOW.DEF WINDOW.STATBAR\n",i);return(1);
}
if(!strnicmp(&str[p.s1],"INTERLACE",9))
{
CMDLOOP fprintf(fo,"WINDOW.DEF P BBS:Node%d/WINDOW.DEF WINDOW.INTERLACE\n",i); return(1);
}
if(!strnicmp(&str[p.s1],"DUPE_FILECHECK",14))
{
fprintf(fo,"DRAWER D BBS:ACCESS ACS.DUPE_FILECHECK\n"); return(1);
}
if(!strnicmp(&str[p.s1],"SUPPRESS_QLOGON",15))
{
CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d DISABLE_QUICK_LOGONS\n",i); return(1);
}
if(!strnicmp(&str[p.s1],"RELATIVE_CONFERENCES",20))
{
fprintf(fo,"CONF.DEF P BBS:CONFCONFIG RELATIVE_CONFERENCES\n"); return(1); }
if(!strnicmp(&str[p.s1],"DOORLOG",7))
{
CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d DOOR_LOG\n",i); return(1); }
if(!strnicmp(&str[p.s1],"STARTLOG",8))
{
CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d START_LOG\n",i); return(1); }
if(!strnicmp(&str[p.s1],"NO_TIMEOUT",10))
{
CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d NO_TIMEOUT\n",i); return(1); }
if(!strnicmp(&str[p.s1],"NO_MCI_MESSAGE",14))
{
CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d NO_MCI_MSG\n",i);return(1); }
if(!strnicmp(&str[p.s1],"BREAK_CHAT",10))
{
CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d BREAK_CHAT\n",i); return(1); }
if(!strnicmp(&str[p.s1],"QUIETNODE",9))
{
CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d QUIETNODE\n",i); return(1); }
if(!strnicmp(&str[p.s1],"SENTBY_FILES",12))
{ CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d SENTBY_FILES\n",i);return(1); }
if(!strnicmp(&str[p.s1],"DEFAULT_CHAT_ON",15))
{ CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d CHAT_ON\n",i); return(1); }
if(!strnicmp(&str[p.s1],"CAPITOLS_in_FILE",16))
{ CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d CAPITOL_FILES\n",i); return(1); }
if(!strnicmp(&str[p.s1],"CHAT_COLOR_SYSOP",16))
{ CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d SYSOP_CHAT_COLOR=%d\n",i,atoi(&str[p.s2])); return(1); }
if(!strnicmp(&str[p.s1],"CHAT_COLOR_USER",15))
{ CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d USER_CHAT_COLOR=%d\n",i,atoi(&str[p.s2])); return(1); }
if(!strnicmp(&str[p.s1],"KEEP_UPLOAD_CREDIT",18))
{ CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d KEEP_UPLOAD_CREDIT=1\n",i); return(1); }
if(!strnicmp(&str[p.s1],"ALLOW_FREE_RESUMING",19))
{ CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d FREE_RESUMING\n",i); return(1); }
if(!strnicmp(&str[p.s1],"DO_CALLERSLOG",13))
{ CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d CALLERS_LOG\n",i); return(1); }
if(!strnicmp(&str[p.s1],"DO_U/D_LOG",10))
{ CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d UD_LOG\n",i); return(1); }
if(!strnicmp(&str[p.s1],"CONF_NAME",9))
{
fprintf(fo,"CONF.DEF P BBS:CONFCONFIG NAME.%d=%s\n",atoi(&str[p.s2]),&str[p.s2+3]);
return(1);
}
if(!strnicmp(&str[p.s1],"CONF_LOCAL",10))
{
fprintf(fo,"CONF.DEF P BBS:CONFCONFIG LOCATION.%d=%s\n",atoi(&str[p.s2]),&str[p.s2+3]);
return(1);
}
if(!strnicmp(&str[p.s1],"SYSTEM_PASSWORD",15))
{ CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d SYSTEM_PASSWORD=%s\n",i,&str[p.s2]); return(1); }
if(!strnicmp(&str[p.s1],"REMOTE_PASSWORD",15))
{ CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d REMOTE_PASSWORD=%s\n",i,&str[p.s2]); return(1); }
if(!strnicmp(&str[p.s1],"NEW_USER_PASSWORD",17))
{ CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d NEWUSER_PASSWORD=%s\n",i,&str[p.s2]); return(1); }
if(!strnicmp(&str[p.s1],"TASK_PRIORITY",13))
{ CMDLOOP fprintf(fo,"DRAWER D BBS:Node%d PRIORITY=%d\n",i,atoi(&str[p.s2])); return(1); }
if(!strnicmp(&str[p.s1],"BBS_NAME",8))
{
fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP BBS_NAME=%s\n",&str[p.s2]); return(1); }
if(!strnicmp(&str[p.s1],"BBS_LOCATION",12))
{ fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP BBS_LOCATION=%s\n",&str[p.s2]); return(1); }
if(!strnicmp(&str[p.s1],"SYSOP_NAME",10))
{ fprintf(fo,"ACP.DEF T AE3.0_Disk1:Wbstartup/ACP SYSOP_NAME=%s\n",&str[p.s2]); return(1); }
if(!strnicmp(&str[p.s1],"TOTAL_CONFERENCES",17))
{ fprintf(fo,"CONF.DEF P BBS:CONFCONFIG NCONFS=%d\n",atoi(&str[p.s2])); return(1); }
}
return(0);
}
void sr(char *str)
{
register int i;
i=strlen(str)-1;
while(i)
{
if(*(str+i)<=32) *(str+i)='\0'; else break;
i--;
}
}
int ParseImage(char *str,struct PSTR *p)
{
register int i;
int returncode=0;
if(!strnicmp(str,"Node",4))
{
if(*(str+4)=='*') { p->ns=0;p->ne=nodes-1; }
else { p->ns=(*(str+4))-'0';p->ne=p->ns; }
returncode=1;
i=5;
p->s2=0;
p->s1=0;
while(*(str+i)!='\0')
{
if(*(str+i)!=' ')
{
p->s1=i; break;
}
i++;
}
while(*(str+i)!='\0')
{
if(*(str+i)==' ') break;
i++;
}
while(*(str+i)!='\0')
{
if(*(str+i)!=' ')
{
p->s2=i; break;
}
i++;
}
}
return(returncode);
}
void strleft(char *str,char *str1)
{
register int i=0,j=0;
while(*(str1+i)==' ') i++;
while(*(str1+i)!='\0'){ *(str+j)=*(str1+i); i++; j++; }
*(str+j)='\0';
}
int atoileft(char str[])
{
register int i=0;
while(str[i]==' ') i++;
return(atoi(&str[i]));
}